<template>
	<view class="hospital-item-box">
		<view class="hospital-item-inner-box">
			<view class="inner-left-box">
				<u-image :src="props.hospital.img" width="160rpx" height="160rpx" radius="10rpx"></u-image>
			</view>
			<view class="inner-right-box">
				<view class="title">{{ props.hospital.hospital_name }}</view>
				<u-gap height="10rpx"></u-gap>
				<view class="level-category-box">
					<view class="level">{{ props.hospital.level }}</view>
					<text class="category">{{ props.hospital.category_name }}</text>
				</view>
				<u-gap height="10rpx"></u-gap>
				<view>{{ props.hospital.address }}</view>
			</view>
		</view>
	</view>
</template>

<script setup lang="ts">
	import type {
		IHospitalItem
	} from '@/pages/index/types';
	import type {
		PropType
	} from 'vue';

	const props = defineProps({
		hospital: {
			type: Object as PropType < IHospitalItem > ,
			required: true,
		},
	});
</script>

<style lang="scss" scoped>
	.hospital-item-box {
		padding: 15rpx 30rpx;

		.hospital-item-inner-box {
			padding: 30rpx;
			background: #fff;
			border-radius: 20rpx;
			display: flex;
			align-items: center;

			.inner-left-box {
				width: 160rpx;
				height: 160rpx;
			}

			.inner-right-box {
				flex: 1;
				font-size: 26rpx;
				margin-left: 20rpx;
				display: flex;
				flex-direction: column;
				justify-content: space-between;

				.title {
					font-size: 32rpx;
					font-weight: 600;
					color: #222222;
				}

				.level-category-box {
					display: flex;
					align-items: center;

					.level {
						background: #fbf6f4;
						border-radius: 4rpx;
						padding: 6rpx 12rpx;
						color: #ec672c;
					}

					.category {
						margin-left: 16rpx;
					}
				}
			}
		}
	}
</style>
